﻿using System;
using System.Windows.Data;
using System.ComponentModel;

namespace Eniux.Windows.Controls.Core.Converters
{
   public class SortDirectionToBoolConverter:IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (value!=null)
            {
                ListSortDirection? lsd = (ListSortDirection)value;
                switch (lsd)
                {
                    case null:{return false;}
                    case ListSortDirection.Ascending:
                    case ListSortDirection.Descending: return true;
                } 
            }
            return false;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
